package com.day0928;

public class Student extends Object {

    private String name = "张三";
    private int age = 18;
    private String stuNo = "10001";
    public String toString(){
        //   "{name:"张三",age:"18",stuNo:"10001"}"
        String str = "{name:" + this.name + ",age:" + this.age + ",stuNo:" + this.stuNo + "}";
        return str;
    }

    public Student(String name, int age, String stuNo) {
        this.name = name;
        this.age = age;
        this.stuNo = stuNo;
    }

    public Student() {
    }

    public boolean equals(Object obj){
        Student student = (Student)obj;
        if (this.stuNo == student.stuNo){
            if (this.name == student.name){
                if (this.age == this.age){
                    return true;
                }
            }
        }
        return false;
    }


}
